package com.wuyan.locationdog.adapter

import android.graphics.Color
import android.widget.TextView
import androidx.annotation.LayoutRes
import com.arcsoft.commonbase.bean.WorkOrderBeanContent
import com.chad.library.adapter.base.BaseQuickAdapter
import com.chad.library.adapter.base.viewholder.BaseViewHolder
import com.wuyan.locationdog.R


class WorkOrderListAdapter(@LayoutRes layoutResId: Int, data: MutableList<WorkOrderBeanContent>?) :
    BaseQuickAdapter<WorkOrderBeanContent, BaseViewHolder>(layoutResId, data) {


    override fun convert(holder: BaseViewHolder, item: WorkOrderBeanContent) {
        holder.apply {
            getView<TextView>(R.id.content).text = item.content
            getView<TextView>(R.id.title).text = item.title
            getView<TextView>(R.id.createTime).text = item.createTime
            getView<TextView>(R.id.workOrderStatusDesc).text = item.workOrderStatusDesc

            if (item.workOrderStatus == 1) {
                getView<TextView>(R.id.workOrderStatusDesc).setTextColor(Color.parseColor("#6E4DF3"))
            } else {
                getView<TextView>(R.id.workOrderStatusDesc).setTextColor(Color.parseColor("#FF6430"))
            }
        }
    }
}


